// 封装axios 
import axios from 'axios';

// 创建axios请求实例
const service = axios.create({
  baseURL: 'http://121.199.0.35:7001',
  timeout: 5000
});

service.interceptors.response.use(response => {
  return response.data
}, error => {
  return Promise.reject()
});

// 封装get请求
export function get(url, params) {
  return service.get(url, {
    params,
    timeout: 10000,
    headers: {
      'X-Requested-With': 'XMLHttpRequest'
    }
  })
}

export default service